function getInt(key,defValue){
    return parseInt(localStorage.getItem(key)||defValue+'',10);
}

const ENV = "dev";
function log(msg){
    if(ENV ==='dev'){
        console.log(msg);
    }
}

//渲染缓存队列配置
// var maxCacheSize = 12;//最大缓存帧
var maxCacheSize = 5;//最大缓存帧

//渲染优化配置
var sliceMode  = true ;//是否启用点云切片渲染
var sliceModeWorking  = false ;//监测是否真正进入切片渲染模式
var ppn = 1*100000;//每个Points对象限制点个数，100W点渲染约200ms,per point number
var subMsgRenderintervalDict={
    1000:50,
    50000:50,
    100000:100,
    200000:120,
    500000:160,
    850000:200,
    1000000:220
}
function getRenderInterval(ppn){
    if(subMsgRenderintervalDict[ppn]){
        return subMsgRenderintervalDict[ppn];
    }else{
        return 50;//默认值
    }
}
var subMsgRenderinterval = getRenderInterval(ppn)


//点云相关配置
var pointScaleSize = 1;//渲染点的坐标放大倍数
var markerSize = pointScaleSize /10;//点云材料尺寸
var raycastPointThreshold = markerSize/2;//point选点的插入阈值
// var raycastPointThreshold = 1;

const MODE_NONE=0;
const MODE_MARK=1;//标点
const MODE_DIRECT=2;//方向
const MODE_EDIT_MARK=3;//编辑

var globalMode = MODE_NONE;
var globalViewer;
var globalPointCloud;

//three 分组常量
const SELECT_OBJECTS_GROUP = "selectableObjects";
const RECT_GROUP = "rect";
const AXES_GROUP = "axes"


var globalConfig = {};//全局配置json
globalConfig['pointScaleSize']=pointScaleSize;
globalConfig['markerSize']=markerSize;
globalConfig['raycastPointThreshold']=raycastPointThreshold;
globalConfig['maxCacheSize']=maxCacheSize;
console.log('globalConfig %o',globalConfig)